home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Draw / CScreen_SelectLevel.as < prev    next >
Text File  |  2011-08-19  |  5KB  |  143 lines

  1. package Local.Draw
  2. {
  3.    import Local.External.CURL;
  4.    import Local.Game.Level.CLevelData;
  5.    import flash.display.MovieClip;
  6.    import flash.events.Event;
  7.    import flash.events.MouseEvent;
  8.    
  9.    public class CScreen_SelectLevel extends CScreen
  10.    {
  11.        
  12.       
  13.       public var mcButtonLevelIcon1:MovieClip;
  14.       
  15.       public var mcButtonLevelIcon3:MovieClip;
  16.       
  17.       public var mcButtonLevelIcon4:MovieClip;
  18.       
  19.       public var mcButtonLevelIcon2:MovieClip;
  20.       
  21.       public var mcBackground:MovieClip;
  22.       
  23.       public var mcLogo:MovieClip;
  24.       
  25.       public var mcButtonBack:MovieClip;
  26.       
  27.       public var mcMoreGames:MovieClip;
  28.       
  29.       public var mcButtonStartWar:MovieClip;
  30.       
  31.       public var mcSize:MovieClip;
  32.       
  33.       public function CScreen_SelectLevel()
  34.       {
  35.          var _loc1_:int = 0;
  36.          if(true)
  37.          {
  38.             super();
  39.             if(true)
  40.             {
  41.                AddButton("startwar",new CScreenButton(mcButtonStartWar,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_STARTLEVEL);
  42.                if(true)
  43.                {
  44.                   AddButton("level0",new CScreenButton(mcButtonLevelIcon1,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  45.                   if(true)
  46.                   {
  47.                      AddButton("level1",new CScreenButton(mcButtonLevelIcon2,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  48.                   }
  49.                   AddButton("level2",new CScreenButton(mcButtonLevelIcon3,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  50.                }
  51.                AddButton("level3",new CScreenButton(mcButtonLevelIcon4,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  52.             }
  53.             _loc1_ = 0;
  54.          }
  55.          while(_loc1_ < 4)
  56.          {
  57.             SelectLevel(_loc1_);
  58.             DeselectLevel(_loc1_);
  59.             _loc1_++;
  60.          }
  61.          AddLogoButton();
  62.          AddBackButton("main");
  63.          AddMoreGamesButton("SelectLevel");
  64.          SelectLevel(0);
  65.       }
  66.       
  67.       private function e_SELECTLEVEL(param1:Event = null) : void
  68.       {
  69.          var _loc2_:CScreenButton = null;
  70.          _loc2_ = CScreenButton(param1.currentTarget);
  71.          SelectLevel(Number(_loc2_.mID.substr(_loc2_.mID.length - 1)));
  72.       }
  73.       
  74.       private function e_VIEWSCORES(param1:MouseEvent = null) : void
  75.       {
  76.          CURL.ViewHiscore(CLevelData.mGameID);
  77.       }
  78.       
  79.       private function e_STARTLEVEL(param1:Event = null) : void
  80.       {
  81.          var _loc2_:CScreenButton = null;
  82.          _loc2_ = CScreenButton(param1.currentTarget);
  83.          CLevelData.mMochiBotTrack();
  84.          mParent.GetScreen("loadinglevel").Activate();
  85.       }
  86.       
  87.       private function DeselectLevel(param1:int) : void
  88.       {
  89.          var _loc2_:MovieClip = null;
  90.          _loc2_ = mButtons["level" + param1].mcButton;
  91.          _loc2_.bViewScores.visible = false;
  92.          _loc2_.mcSelected.visible = false;
  93.          _loc2_.mcSelected.enabled = false;
  94.          mButtons["level" + param1].mEnabled = true;
  95.       }
  96.       
  97.       private function SelectLevel(param1:int) : void
  98.       {
  99.          var _loc2_:int = 0;
  100.          var _loc3_:MovieClip = null;
  101.          if(true)
  102.          {
  103.             _loc2_ = 0;
  104.          }
  105.          for(; _loc2_ < 4; _loc2_++)
  106.          {
  107.             if(_loc2_ != param1)
  108.             {
  109.                if(false)
  110.                {
  111.                   _loc3_ = mButtons["level" + param1].mcButton;
  112.                   if(true)
  113.                   {
  114.                      _loc3_.tbName.text = CLevelData.mName + " (" + CLevelData.mDifficulty + ")";
  115.                      if(true)
  116.                      {
  117.                         _loc3_.mcGraphic.gotoAndStop(1 + param1);
  118.                         if(true)
  119.                         {
  120.                            _loc3_.bViewScores.visible = true;
  121.                            _loc3_.bViewScores.addEventListener(MouseEvent.MOUSE_DOWN,e_VIEWSCORES);
  122.                         }
  123.                         _loc3_.mcSelected.visible = true;
  124.                      }
  125.                      mButtons["level" + param1].mEnabled = false;
  126.                   }
  127.                   return;
  128.                }
  129.                DeselectLevel(_loc2_);
  130.                if(false)
  131.                {
  132.                   break;
  133.                }
  134.                continue;
  135.                addr37:
  136.             }
  137.          }
  138.          CLevelData.mLevelIndex = param1;
  139.          ┬º┬ºgoto(addr37);
  140.       }
  141.    }
  142. }
  143.